ident = '$Id: encode_images.py 135 2006-06-28 19:23:00Z ahmad $'

#!python
#----------------------------------------------------------------------

"""
This is a way to save the startup time when running img2py on lots of
files...
"""

import os, sys, string
from wx.tools import img2py

command_lines = [
#	" 	 -u -n 		Splash pixmaps/splash.png						images.py",
	" 	 -u -n 		ProSplash pixmaps/ede_splash.png			images.py",
	" -a -u -i -n 	ESM pixmaps/esm.ico								images.py",
#	" -a -u -i -n 	NewsletterModule pixmaps/newsletter_module.ico 	images.py",
#	" -a -u -i -n 	WebModule pixmaps/web_module.ico 				images.py",
#	" -a -u -i -n 	EmailModule pixmaps/email_module.ico 			images.py",
#	" -a -u -i -n 	SurveyModule pixmaps/survey_module.ico 			images.py",
#	" -a -u -i -n 	ReferralModule pixmaps/referral_module.ico 		images.py",
#	" -a -u -i -n 	BindersModule pixmaps/binders_module.ico 		images.py",
#	" -a -u -i -n 	ContactsModule pixmaps/contacts_module.ico 		images.py",
	" -a -u    -n 	BigESM pixmaps/esm.png 							images.py",
	" -a -u    -n 	Disconnected pixmaps/disconnected.png 			images.py",
	" -a -u    -n 	Connecting pixmaps/connecting.png 				images.py",
	" -a -u    -n 	Connected pixmaps/connected.png 				images.py",
	" -a -u    -n 	Failed pixmaps/failed.png 						images.py",
	" -a -u    -n 	Save pixmaps/save.png 							images.py",
	" -a -u    -n 	Close pixmaps/close.png 						images.py",
	" -a -u    -n 	RedClose pixmaps/red_close.png 					images.py",
	" -a -u    -n 	Preview pixmaps/preview.png 					images.py",
	" -a -u    -n 	Zoom pixmaps/zoom.png 							images.py",
	" -a -u    -n 	Refresh pixmaps/refresh.png 					images.py",
	" -a -u    -n 	Contact pixmaps/contact.png 					images.py",
	" -a -u    -n 	Group pixmaps/group.png 						images.py",
	" -a -u    -n 	NewContact pixmaps/new_contact.png 				images.py",
	" -a -u    -n 	NewGroup pixmaps/new_group.png 					images.py",
	" -a -u    -n 	LeftArrow pixmaps/left_arrow.png 				images.py",
	" -a -u    -n 	RightArrow pixmaps/right_arrow.png 				images.py",
	" -a -u    -n 	UpArrow pixmaps/up_arrow.png 					images.py",
	" -a -u    -n 	DownArrow pixmaps/down_arrow.png 				images.py",
	" -a -u    -n 	MatchCase pixmaps/match_case.png 				images.py",
	" -a -u    -n 	NoMatchCase pixmaps/nomatch_case.png 			images.py",
	" -a -u    -n 	ReplaceAll pixmaps/replace_all.png 				images.py",
	" -a -u    -n 	ReplaceSelection pixmaps/replace_selection.png 	images.py",
	" -a -u    -n 	FolderW pixmaps/folder_w.png 					images.py",
	" -a -u    -n 	FolderN pixmaps/folder_n.png 					images.py",
	" -a -u    -n 	FolderE pixmaps/folder_e.png 					images.py",
	" -a -u    -n 	NewFolderW pixmaps/new_folder_w.png 			images.py",
	" -a -u    -n 	NewFolderN pixmaps/new_folder_n.png 			images.py",
	" -a -u    -n 	NewFolderE pixmaps/new_folder_e.png 			images.py",
	" -a -u    -n 	IssueW pixmaps/issue_w.png 						images.py",
	" -a -u    -n 	IssueN pixmaps/issue_n.png 						images.py",
	" -a -u    -n 	IssueE pixmaps/issue_e.png 						images.py",
	" -a -u -i -n 	Binder pixmaps/binder.png 						images.py",
	" -a -u    -n 	NewBinder pixmaps/new_binder.png 				images.py",
	" -a -u    -n 	Instance pixmaps/instance.png 					images.py",
	" -a -u    -n 	NewInstance pixmaps/new_instance.png 			images.py",
	" -a -u    -n 	Variable pixmaps/variable.png 					images.py",
	" -a -u    -n 	Optimization pixmaps/optimization.png 			images.py",
	" -a -u    -n 	UniqueOptimization pixmaps/unique_optimization.png 	images.py",
	" -a -u    -n 	MirrorBinder pixmaps/mirror_binder.png 			images.py",
	" -a -u    -n 	SystemBinder pixmaps/system_binder.png 			images.py",
	" -a -u    -n 	Equals pixmaps/equals.png 						images.py",
	" -a -u    -n 	NotEquals pixmaps/not_equals.png 				images.py",
	" -a -u    -n 	Contains pixmaps/contains.png 					images.py",
	" -a -u    -n 	NotContains pixmaps/not_contains.png 			images.py",
	" -a -u    -n 	Publish pixmaps/publish.png 					images.py",
	" -a -u    -n 	HtmlFormat pixmaps/html_format.png 				images.py",
	" -a -u    -n 	TextFormat pixmaps/text_format.png 				images.py",
	" -a -u    -n 	HtmlTextFormat pixmaps/html_text_format.png 	images.py",
	" -a -u    -n 	Form pixmaps/form.png							images.py",
	" -a -u    -n 	NewForm pixmaps/new_form.png					images.py",
	" -a -u    -n 	Survey pixmaps/survey.png						images.py",
	" -a -u    -n 	Promotion pixmaps/promotion.png					images.py",
	" -a -u    -n 	NewPromotion pixmaps/new_promotion.png			images.py",
	" -a -u    -n 	Referral pixmaps/referral.png					images.py",
	" -a -u    -n 	SmallUpArrow  -m #0000FF pixmaps/sm_up.bmp 		images.py",
	" -a -u    -n 	SmallDnArrow  -m #0000FF pixmaps/sm_down.bmp 	images.py",
	" -a -u    -n 	PlusSign pixmaps/plus.png 						images.py",
	" -a -u    -n 	MinusSign pixmaps/minus.png 					images.py",
	" -a -u    -n 	HtmlIcon pixmaps/html_icon.png 					images.py",
	" -a -u    -n 	TextIcon pixmaps/text_icon.png 					images.py",
	" -a -u    -n 	HtmlFileIcon pixmaps/html_file_icon.png 		images.py",
	" -a -u    -n 	QuestionsIcon pixmaps/questions_icon.png 		images.py",
	" -a -u    -n 	NotifiersIcon pixmaps/notifiers_icon.png 		images.py",
	" -a -u    -n 	EmailIcon pixmaps/email_icon.png 				images.py",
#	" -a -u    -n 	NewsletterService pixmaps/newsletter_service_icon.png 	images.py",
#	" -a -u    -n 	WebService pixmaps/web_service_icon.png 		images.py",
#	" -a -u    -n 	EmailService pixmaps/email_service_icon.png 	images.py",
#	" -a -u    -n 	SurveyService pixmaps/survey_service_icon.png 	images.py",
	" -a -u    -n 	ScriptHelper pixmaps/script_helper.png 	images.py",
#	" -a -u    -n 	ReferralService pixmaps/referral_service_icon.png images.py",
	" -a -u    -n 	Activation pixmaps/activation.png images.py"
    ]


for line in command_lines:
    args = string.split(line)
    img2py.main(args)

# Fix the missing wxEmptyIcon by importing wxPython.wx
fullpath = os.getcwd() + "/images.py"
f=open( fullpath, 'r' )
filebody=f.read()
f.close
filebody = filebody.replace( "from wx import ", "from wx import EmptyIcon," )
f=open( fullpath, 'w' )
f.write( filebody )
f.close
